package com.yumeno.market_goods.service.impl;

import com.yumeno.market_goods.dao.UserDao;
import com.yumeno.market_goods.pojo.entity.User;
import com.yumeno.market_goods.service.UserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import javax.annotation.Resources;

@Service
public class UserServiceImpl implements UserService {

    @Resource
    UserDao userDao;


    @Override
    public boolean login(User user) {
        User dbUser=userDao.selectByPhone(user.getPhone());
        if (dbUser==null){
            return false;
        }else if (user.getPassword()==null){
            return false;
        }else {
            return dbUser.getPassword().equals(user.getPassword());
        }
    }
}
